CREATE TABLE [dbo].[File]
(
[Id] [int] NOT NULL IDENTITY(1, 1),
[Url] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Title] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ParentId] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrderIndex] [int] NOT NULL CONSTRAINT [DF_File_OrderIndex] DEFAULT ((0)),
[IsPublished] [bit] NOT NULL CONSTRAINT [DF_File_IsPublished] DEFAULT ((0)),
[FileType] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreatedDate] [datetime] NOT NULL CONSTRAINT [DF_File_CreatedDate] DEFAULT (getdate()),
[UpdatedDate] [datetime] NOT NULL CONSTRAINT [DF_File_UpdatedDate] DEFAULT (getdate()),
[CreatedUser] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UpdatedUser] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Catalog] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[File] ADD CONSTRAINT [PK_File] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Loại file: image, file khác', 'SCHEMA', N'dbo', 'TABLE', N'File', 'COLUMN', N'FileType'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Id cha, dùng để lấy danh sách file theo parent [article, hospital...]', 'SCHEMA', N'dbo', 'TABLE', N'File', 'COLUMN', N'ParentId'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Id cha, dùng để lấy danh sách file theo parent [article...]', 'SCHEMA', N'dbo', 'TABLE', N'File', 'COLUMN', N'Title'
GO
